<%--
  Created by IntelliJ IDEA.
  User: RJXY
  Date: 2025/2/24
  Time: 13:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script src="./static/jquery.js"></script>
<body>
<h1>第二节课</h1>
<form id="form" action="/test" method="get">
    姓名：<input type="text" name="username"><br>
    密码: <input type="text" name="password"><br>
    <input type="submit">
<%--    <input onclick="fn()" type="button" value="按钮">--%>
</form>
</body>
<script>


    function fn() {
        var str = $("#form").serialize();
        $.ajax({
            type: 'post',
            url : '/demo/test',
            data: str,
            dataType: 'json',
            success: function (res) {
                console.log(res)
            },
        })
    }

</script>
</html>
